﻿#include "../suduku_without_gui/header.h"
#include "RepeationTest.h"
#include "SudokuProblemMaker.h"

using namespace std;

void showHelpTest()
{
	cout << "Help:\n"
		<< "\tmake problem\n"
		<< "\tInterpretionTest.exe -s path_base_sudoku_txt path_of_out_problem_txt\n"
		<< "\tcheck number of sudoku , repeation and right\n"
		<< "\tInterpretionTest.exe -c path_of_sudoku\n"
		<< "\n\n\n";
}

int wmain(int argc, wchar_t* argv[])
{
	LARGE_INTEGER n_freq;
	LARGE_INTEGER t1;
	LARGE_INTEGER t2;
	double dt;
	QueryPerformanceFrequency(&n_freq);
	QueryPerformanceCounter(&t1);

	closeTxt();

	if (lstrcmp(argv[1], L"-s") == 0 and argc == 4)
	{
		makeSudokuProblem(argv[2], argv[3]);
	}
	else if (lstrcmp(argv[1], L"-c") == 0 and argc == 3)
	{
		if (checkRepeationTest(argv[2]))
		{
			cout << "Repeation" << endl;
		}
		else
			cout << "No Repeation" << endl;
	}
	else
		showHelpTest();
	closeTxt();

	

	QueryPerformanceCounter(&t2);
	dt = (t2.QuadPart - t1.QuadPart) / (double)n_freq.QuadPart;
	std::cout << "TestRunning time:" << dt << "s" << std::endl;

	return 0;
}

